Replace existing sources before updating
authorAlex Crichton <alex@alexcrichton.com>
Wed, 30 Mar 2016 17:39:24 +0000 (10:39 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 30 Mar 2016 17:39:24 +0000 (10:39 -0700)
commit18e593044d900236d4079b06902dd6bbfb2c4456
tree7cfd7e2d0f31b22145a1127b962d82231f3361d5
parentabdc756cc17f08c5b461cef275e66820ea1654b5
Replace existing sources before updating

Currently sources may acquire file locks to ensure that they're not tampered
with while they're in use. We may load two sources to the same location,
however, in the case of git repositories which need to be updated. Cargo will
first load a locked version of the source and then may load an unlocked version,
and these two loads currently deadlock.

This commit tweaks the logic when updating a source to only update it after the
previous source has been replaced.

Closes #2533
src/cargo/core/registry.rs
tests/test_cargo_compile_git_deps.rs